package Interfaz;

import java.awt.color.*;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import javax.swing.BorderFactory;

import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpinnerListModel;
import javax.swing.SwingConstants;

import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import Juego.JuegoCliente;
import ModJuego.Color;
import ModJuego.JuegoServidorPrx;
import ModJuego.JuegoServidorPrxHelper;
import ModJuego.Turno;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */

public class InterfazJugador extends javax.swing.JFrame {
	final int grupoA = 0;
	final int grupoB = 1;
	final int ultimaRonda = 7;
	private JButton votarRojo;
	private JScrollPane jScrollPane1;
	private JScrollPane jScrollPane2;
	private JLabel r5;
	private JLabel r4;
	private JLabel r3;
	private JLabel r2;
	private JLabel r1;
	private JLabel nombreEquipo2;
	private JLabel nombreEquipo1;
	private JPanel jPanelMarcador;
	private JTextField msg;
	private JTextArea jTextArea2;
	private JTextArea jTextArea1;
	private JButton salir;
	private JButton chat;
	private JLabel a1;
	private JLabel a4;
	private JLabel labelLog;
	private JLabel labelChat;
	private JButton votarNegro;
	private JLabel totalb;
	private JLabel totala;
	private JLabel b8;
	private JLabel a8;
	private JLabel b7;
	private JLabel a7;
	private JLabel b6;
	private JLabel a6;
	private JLabel b5;
	private JLabel a5;
	private JLabel b4;
	private JLabel b3;
	private JLabel jLabelEmpate;
	private JLabel jLabelPerdedor;
	private JLabel jLabelGanador;
	private JPanel jPanelResultado;
	private JLabel marcador;
	private JLabel a3;
	private JLabel b2;
	private JLabel a2;
	private JLabel b1;
	private JLabel t;
	private JLabel r8;
	private JLabel r7;
	private JLabel r6;
	private JuegoCliente cliente;
	private JLabel[][] tablero;
	/**
	 * Auto-generated main method to display this JFrame
	 */
	/*
	 * public static void main(String[] args) { SwingUtilities.invokeLater(new
	 * Runnable() { public void run() { Cliente inst = new Cliente();
	 * inst.setLocationRelativeTo(null); inst.setVisible(true); } }); }
	 */

	public InterfazJugador() {
		super();
		tablero = new JLabel[2][9];
		initGUI();
		IniciarTablero();
		desactivaBotonesVotacion();
	}

	public void setCliente(JuegoCliente j) {
		cliente = j;
	}
	
	public JuegoCliente getCliente(){
		return cliente;
	}

	private void IniciarTablero() {
		tablero[grupoA][0] = a1;
		tablero[grupoB][0] = b1;

		tablero[grupoA][1] = a2;
		tablero[grupoB][1] = b2;

		tablero[grupoA][2] = a3;
		tablero[grupoB][2] = b3;

		tablero[grupoA][3] = a4;
		tablero[grupoB][3] = b4;

		tablero[grupoA][4] = a5;
		tablero[grupoB][4] = b5;

		tablero[grupoA][5] = a6;
		tablero[grupoB][5] = b6;

		tablero[grupoA][6] = a7;
		tablero[grupoB][6] = b7;

		tablero[grupoA][7] = a8;
		tablero[grupoB][7] = b8;

		tablero[grupoA][8] = totala;
		tablero[grupoB][8] = totalb;
	}

	private void initGUI() {

		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			getContentPane().setBackground(new java.awt.Color(217,236,255));
			this.setIconImage(new ImageIcon(getClass().getClassLoader()
					.getResource("Imagenes/icono1.png")).getImage());
			this.setTitle("Jugador");
			this.setFocusable(false);
			{
				chat = new JButton();
				getContentPane().add(chat);
				getContentPane().add(getSalir());
				getContentPane().add(getJScrollPane1());
				getContentPane().add(getJScrollPane2());
				getContentPane().add(getMsg());
				getContentPane().add(getJPanelMarcador());
				getContentPane().add(getLabelChat());
				getContentPane().add(getLabelLog());
				getContentPane().add(getMarcador());
				chat.setText("Enviar");
				chat.setBounds(391, 426, 111, 34);
				chat.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						chatMouseClicked(evt);
					}
				});
			}
			this.setFocusCycleRoot(false);
			getContentPane().setForeground(new java.awt.Color(217,236,255));
			this.setResizable(false);
			pack();
			this.setSize(929, 533);
		} catch (Exception e) {
			// add your error handling code here
			e.printStackTrace();
		}

	}

	private JButton getSalir() {
		if (salir == null) {
			salir = new JButton();
			salir.setText("Salir");
			salir.setBounds(770, 426, 100, 34);
			salir.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					salirMouseClicked(evt);
				}
			});
		}
		return salir;
	}

	private JScrollPane getJScrollPane1() {
		if (jScrollPane1 == null) {
			jScrollPane1 = new JScrollPane();
			jScrollPane1.setBounds(514, 275, 356, 139);
			jScrollPane1.setViewportView(getJTextArea1());
		}
		return jScrollPane1;
	}

	private JTextArea getJTextArea1() {
		if (jTextArea1 == null) {
			jTextArea1 = new JTextArea();
			jTextArea1.setEditable(false);
			jTextArea1.setBounds(514, 275, 353, 136);
		}
		return jTextArea1;
	}

	private JScrollPane getJScrollPane2() {
		if (jScrollPane2 == null) {
			jScrollPane2 = new JScrollPane();
			jScrollPane2.setBounds(37, 275, 465, 139);
			jScrollPane2.setViewportView(getJTextArea2());
		}
		return jScrollPane2;
	}

	private JTextArea getJTextArea2() {
		if (jTextArea2 == null) {
			jTextArea2 = new JTextArea();
			jTextArea2.setEditable(false);
			jTextArea2.setBounds(19, 231, 423, 101);
		}
		return jTextArea2;
	}

	private JTextField getMsg() {
		if (msg == null) {
			msg = new JTextField();
			msg.setBounds(37, 426, 342, 34);
		}
		return msg;
	}

	public void msgServidor(String cadena) {
		jTextArea1.append(cadena + "\n");
	}

	public void msgChat(String cadena) {
		jTextArea2.append(cadena + "\n");
	}

	private void chatMouseClicked(MouseEvent evt) {
		String mensaje = msg.getText();
		cliente.EnviarMensaje(mensaje);
		msg.setText("");
	}

	private JPanel getJPanelMarcador() {
		if (jPanelMarcador == null) {
			jPanelMarcador = new JPanel();
			jPanelMarcador.setBounds(37, 56, 833, 174);
			jPanelMarcador.setLayout(null);
			jPanelMarcador.setBorder(BorderFactory.createTitledBorder(""));
			jPanelMarcador.setEnabled(false);
			jPanelMarcador.setBackground(new java.awt.Color(255, 255, 255));
			jPanelMarcador.add(getNombreEquipo1());
			jPanelMarcador.add(getNombreEquipo2());
			jPanelMarcador.add(getR1());
			jPanelMarcador.add(getR2());
			jPanelMarcador.add(getR3());
			jPanelMarcador.add(getR4());
			jPanelMarcador.add(getR5());
			jPanelMarcador.add(getR6());
			jPanelMarcador.add(getR7());
			jPanelMarcador.add(getR8());
			jPanelMarcador.add(getT());
			jPanelMarcador.add(getA1());
			jPanelMarcador.add(getB1());
			jPanelMarcador.add(getA2());
			jPanelMarcador.add(getB2());
			jPanelMarcador.add(getB3());
			jPanelMarcador.add(getA3());
			jPanelMarcador.add(getA4());
			jPanelMarcador.add(getB4());
			jPanelMarcador.add(getB6());
			jPanelMarcador.add(getVotarNegro());
			{
				votarRojo = new JButton();
				jPanelMarcador.add(votarRojo);
				jPanelMarcador.add(getA5());
				jPanelMarcador.add(getB5());
				jPanelMarcador.add(getA6());
				jPanelMarcador.add(getA7());
				jPanelMarcador.add(getB7());
				jPanelMarcador.add(getA8());
				jPanelMarcador.add(getB8());
				jPanelMarcador.add(getTotala());
				jPanelMarcador.add(getTotalb());
				jPanelMarcador.add(getJLabelGanador());
				jPanelMarcador.add(getJLabel1());
				jPanelMarcador.add(getJLabelEmpate());
				votarRojo.setText("Votar Rojo");
				votarRojo.setBounds(39, 32, 120, 34);
				votarRojo.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						votoMouseClicked(evt);
					}
				});
			}
		}
		return jPanelMarcador;
	}

	private JLabel getNombreEquipo1() {
		if (nombreEquipo1 == null) {
			nombreEquipo1 = new JLabel();
			nombreEquipo1.setText("        Equipo A:");
			nombreEquipo1.setBounds(206, 66, 100, 34);
			nombreEquipo1.setFont(new java.awt.Font("Segoe UI", 1, 12));
			nombreEquipo1.setBorder(BorderFactory.createTitledBorder(""));
		}
		return nombreEquipo1;
	}

	private JLabel getNombreEquipo2() {
		if (nombreEquipo2 == null) {
			nombreEquipo2 = new JLabel();
			nombreEquipo2.setText("        Equipo B:");
			nombreEquipo2.setBounds(206, 100, 100, 34);
			nombreEquipo2.setFont(new java.awt.Font("Segoe UI", 1, 12));
			nombreEquipo2.setBorder(BorderFactory.createTitledBorder(""));
		}
		return nombreEquipo2;
	}

	private JLabel getR1() {
		if (r1 == null) {
			r1 = new JLabel();
			r1.setText(" Ronda 1");
			r1.setBounds(306, 32, 54, 34);
			r1.setBorder(BorderFactory.createTitledBorder(""));
			r1.setFont(new java.awt.Font("Segoe UI", 1, 12));
		}
		return r1;
	}

	private JLabel getR2() {
		if (r2 == null) {
			r2 = new JLabel();
			r2.setText(" Ronda 2");
			r2.setBounds(360, 32, 54, 34);
			r2.setBorder(BorderFactory.createTitledBorder(""));
			r2.setFont(new java.awt.Font("Segoe UI", 1, 12));
		}
		return r2;
	}

	private JLabel getR3() {
		if (r3 == null) {
			r3 = new JLabel();
			r3.setText(" Ronda 3");
			r3.setBounds(414, 32, 54, 34);
			r3.setBorder(BorderFactory.createTitledBorder(""));
			r3.setFont(new java.awt.Font("Segoe UI", 1, 12));
		}
		return r3;
	}

	private JLabel getR4() {
		if (r4 == null) {
			r4 = new JLabel();
			r4.setText(" Ronda 4");
			r4.setBounds(468, 32, 54, 34);
			r4.setBorder(BorderFactory.createTitledBorder(""));
			r4.setFont(new java.awt.Font("Segoe UI", 1, 12));
		}
		return r4;
	}

	private JLabel getR5() {
		if (r5 == null) {
			r5 = new JLabel();
			r5.setText(" Ronda 5");
			r5.setBounds(522, 32, 54, 34);
			r5.setFont(new java.awt.Font("Segoe UI", 1, 12));
			r5.setBorder(BorderFactory.createTitledBorder(""));
		}
		return r5;
	}

	private JLabel getR6() {
		if (r6 == null) {
			r6 = new JLabel();
			r6.setText(" Ronda 6");
			r6.setBounds(576, 32, 54, 34);
			r6.setFont(new java.awt.Font("Segoe UI", 1, 12));
			r6.setBorder(BorderFactory.createTitledBorder(""));
		}
		return r6;
	}

	private JLabel getR7() {
		if (r7 == null) {
			r7 = new JLabel();
			r7.setText(" Ronda 7");
			r7.setBounds(630, 32, 54, 34);
			r7.setBorder(BorderFactory.createTitledBorder(""));
			r7.setFont(new java.awt.Font("Segoe UI", 1, 12));
		}
		return r7;
	}

	private JLabel getR8() {
		if (r8 == null) {
			r8 = new JLabel();
			r8.setText(" Ronda 8");
			r8.setBounds(684, 32, 54, 34);
			r8.setFont(new java.awt.Font("Segoe UI", 1, 12));
			r8.setBorder(BorderFactory.createTitledBorder(""));
		}
		return r8;
	}

	private JLabel getT() {
		if (t == null) {
			t = new JLabel();
			t.setText("    Total");
			t.setBounds(738, 32, 54, 34);
			t.setFont(new java.awt.Font("Segoe UI", 1, 12));
			t.setBorder(BorderFactory.createTitledBorder(""));
		}
		return t;
	}

	private JLabel getA1() {
		if (a1 == null) {
			a1 = new JLabel();
			a1.setText("0");
			a1.setBounds(306, 66, 54, 34);
			a1.setBorder(BorderFactory.createTitledBorder(""));
			a1.setOpaque(true);
			a1.setHorizontalAlignment(SwingConstants.CENTER);
			a1.setHorizontalTextPosition(SwingConstants.CENTER);
		}
		return a1;
	}

	private JLabel getB1() {
		if (b1 == null) {
			b1 = new JLabel();
			b1.setText("0");
			b1.setBounds(306, 100, 54, 34);
			b1.setBorder(BorderFactory.createTitledBorder(""));
			b1.setOpaque(true);
			b1.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b1;
	}

	private JLabel getA2() {
		if (a2 == null) {
			a2 = new JLabel();
			a2.setText("0");
			a2.setBounds(360, 66, 54, 34);
			a2.setBorder(BorderFactory.createTitledBorder(""));
			a2.setOpaque(true);
			a2.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a2;
	}

	private JLabel getB2() {
		if (b2 == null) {
			b2 = new JLabel();
			b2.setText("0");
			b2.setBounds(360, 100, 54, 34);
			b2.setBorder(BorderFactory.createTitledBorder(""));
			b2.setOpaque(true);
			b2.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b2;
	}

	private JLabel getA3() {
		if (a3 == null) {
			a3 = new JLabel();
			a3.setText("0");
			a3.setBounds(414, 66, 54, 34);
			a3.setBorder(BorderFactory.createTitledBorder(""));
			a3.setOpaque(true);
			a3.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a3;
	}

	private JLabel getB3() {
		if (b3 == null) {
			b3 = new JLabel();
			b3.setText("0");
			b3.setBounds(414, 100, 54, 34);
			b3.setBorder(BorderFactory.createTitledBorder(""));
			b3.setOpaque(true);
			b3.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b3;
	}

	private JButton getVotarNegro() {
		if (votarNegro == null) {
			votarNegro = new JButton();
			votarNegro.setText("Votar Negro");
			votarNegro.setBounds(39, 100, 120, 34);
			votarNegro.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent evt) {
					votarNegroMouseClicked(evt);
				}
			});
		}
		return votarNegro;
	}

	private JLabel getLabelChat() {
		if (labelChat == null) {
			labelChat = new JLabel();
			labelChat.setText(" CHAT");
			labelChat.setBounds(37, 241, 66, 34);
			labelChat.setFont(new java.awt.Font("Segoe UI", 1, 20));
		}
		return labelChat;
	}

	private JLabel getLabelLog() {
		if (labelLog == null) {
			labelLog = new JLabel();
			labelLog.setText("SERVIDOR");
			labelLog.setBounds(514, 242, 100, 34);
			labelLog.setFont(new java.awt.Font("Segoe UI", 1, 20));
		}
		return labelLog;
	}

	private JLabel getA4() {
		if (a4 == null) {
			a4 = new JLabel();
			a4.setText("0");
			a4.setBounds(468, 66, 54, 34);
			a4.setBorder(BorderFactory.createTitledBorder(""));
			a4.setOpaque(true);
			a4.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a4;
	}

	private JLabel getB4() {
		if (b4 == null) {
			b4 = new JLabel();
			b4.setText("0");
			b4.setBounds(468, 100, 54, 34);
			b4.setBorder(BorderFactory.createTitledBorder(""));
			b4.setOpaque(true);
			b4.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b4;
	}

	private JLabel getA5() {
		if (a5 == null) {
			a5 = new JLabel();
			a5.setText("0");
			a5.setBounds(522, 66, 54, 34);
			a5.setBorder(BorderFactory.createTitledBorder(""));
			a5.setOpaque(true);
			a5.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a5;
	}

	private JLabel getB5() {
		if (b5 == null) {
			b5 = new JLabel();
			b5.setText("0");
			b5.setBounds(522, 100, 54, 34);
			b5.setBorder(BorderFactory.createTitledBorder(""));
			b5.setOpaque(true);
			b5.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b5;
	}

	private JLabel getA6() {
		if (a6 == null) {
			a6 = new JLabel();
			a6.setText("0");
			a6.setBounds(576, 66, 54, 34);
			a6.setBorder(BorderFactory.createTitledBorder(""));
			a6.setOpaque(true);
			a6.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a6;
	}

	private JLabel getB6() {
		if (b6 == null) {
			b6 = new JLabel();
			b6.setText("0");
			b6.setBounds(576, 100, 54, 34);
			b6.setBorder(BorderFactory.createTitledBorder(""));
			b6.setOpaque(true);
			b6.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b6;
	}

	private JLabel getA7() {
		if (a7 == null) {
			a7 = new JLabel();
			a7.setText("0");
			a7.setBounds(630, 66, 54, 34);
			a7.setBorder(BorderFactory.createTitledBorder(""));
			a7.setOpaque(true);
			a7.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a7;
	}

	private JLabel getB7() {
		if (b7 == null) {
			b7 = new JLabel();
			b7.setText("0");
			b7.setBounds(630, 100, 54, 34);
			b7.setBorder(BorderFactory.createTitledBorder(""));
			b7.setOpaque(true);
			b7.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b7;
	}

	private JLabel getA8() {
		if (a8 == null) {
			a8 = new JLabel();
			a8.setText("0");
			a8.setBounds(684, 66, 54, 34);
			a8.setBorder(BorderFactory.createTitledBorder(""));
			a8.setOpaque(true);
			a8.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return a8;
	}

	private JLabel getB8() {
		if (b8 == null) {
			b8 = new JLabel();
			b8.setText("0");
			b8.setBounds(684, 100, 54, 34);
			b8.setBorder(BorderFactory.createTitledBorder(""));
			b8.setOpaque(true);
			b8.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return b8;
	}

	private JLabel getTotala() {
		if (totala == null) {
			totala = new JLabel();
			totala.setText("0");
			totala.setBounds(738, 66, 54, 34);
			totala.setOpaque(true);
			totala.setBorder(BorderFactory.createTitledBorder(""));
			totala.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return totala;
	}

	private JLabel getTotalb() {
		if (totalb == null) {
			totalb = new JLabel();
			totalb.setText("0");
			totalb.setBounds(738, 100, 54, 34);
			totalb.setBorder(BorderFactory.createTitledBorder(""));
			totalb.setOpaque(true);
			totalb.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return totalb;
	}

	private JLabel getMarcador() {
		if (marcador == null) {
			marcador = new JLabel();
			marcador.setText(" MARCADOR DE PUNTUACIONES");
			marcador.setBounds(37, 22, 354, 34);
			marcador.setFont(new java.awt.Font("Segoe UI", 1, 20));
		}
		return marcador;
	}

	public void ActualizarTablero(Turno[] puntos, int ronda) {
		//El if se borra si no conseguimos reiniciar
		if(ronda<0){
			for(int i=0; i<9; i++){
				tablero[grupoA][i].setText("0");
				tablero[grupoB][i].setText("0");
				reinicio();
			}
		}else{
		tablero[grupoA][ronda].setText(Integer.toString(puntos[ronda].puntosA));
		tablero[grupoB][ronda].setText(Integer.toString(puntos[ronda].puntosB));
		if(ronda==ultimaRonda){
			tablero[grupoA][ronda+1].setText(Integer.toString(puntos[ronda+1].puntosA));
			tablero[grupoB][ronda+1].setText(Integer.toString(puntos[ronda+1].puntosB));
			//Falta Proclamar ganador!!
		}
		else{
			activaBotonesVotacion();
		}
		}
	}

	private void enviaVoto(Color c) {
		desactivaBotonesVotacion();
		cliente.Votar(c);
	}

	private void votoMouseClicked(MouseEvent evt) {
		enviaVoto(Color.Rojo);
	}

	private void votarNegroMouseClicked(MouseEvent evt) {
		enviaVoto(Color.Negro);
	}

	private void desactivaBotonesVotacion() {
		this.votarNegro.setEnabled(false);
		this.votarRojo.setEnabled(false);
	}

	public void activaBotonesVotacion() {
		this.votarNegro.setEnabled(true);
		this.votarRojo.setEnabled(true);
	}
	
	private void salirMouseClicked(MouseEvent evt) {
		cliente.EnviarMensaje("Que jugaba en el puerto "+cliente.getPuertoJug()+" ha abandonado");
		cliente.parar();
		dispose();
	}
	
	
	
	private JLabel getJLabelGanador() {
		if(jLabelGanador == null) {
			jLabelGanador = new JLabel();
			jLabelGanador.setBounds(13, 16, 181, 141);
			jLabelGanador.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/winner.jpg")));
			jLabelGanador.setOpaque(true);
			jLabelGanador.setVisible(false);
		}
		return jLabelGanador;
	}

	
	public void SoyGanador(){
		jLabelGanador.setVisible(true);
		jLabelPerdedor.setVisible(false);
		jLabelEmpate.setVisible(false);
		votarNegro.setVisible(false);
		votarRojo.setVisible(false);
	}
	
	public void SoyPerdedor(){
		jLabelPerdedor.setVisible(true);
		jLabelEmpate.setVisible(false);
		jLabelGanador.setVisible(false);
		votarNegro.setVisible(false);
		votarRojo.setVisible(false);
		
	}
	
	public void Empate(){
		jLabelEmpate.setVisible(true);
		jLabelGanador.setVisible(false);
		jLabelPerdedor.setVisible(false);
		votarNegro.setVisible(false);
		votarRojo.setVisible(false);
	}
	
	private JLabel getJLabel1() {
		if(jLabelPerdedor == null) {
			jLabelPerdedor = new JLabel();
			jLabelPerdedor.setBounds(13, 10, 181, 157);
			jLabelPerdedor.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/looser.jpg")));
			jLabelPerdedor.setVisible(false);
		}
		return jLabelPerdedor;
	}

	public void reinicio(){
		jLabelPerdedor.setVisible(false);
		jLabelGanador.setVisible(false);
		jLabelEmpate.setVisible(false);
		votarNegro.setVisible(true);
		votarNegro.setEnabled(true);
		votarRojo.setVisible(true);
		votarRojo.setEnabled(true);
	}
	
	private JLabel getJLabelEmpate() {
		if(jLabelEmpate == null) {
			jLabelEmpate = new JLabel();
			jLabelEmpate.setBounds(13, 10, 187, 145);
			jLabelEmpate.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/Empate.jpg")));
			jLabelEmpate.setVisible(false);
		}
		return jLabelEmpate;
	}
}
